package org.yoki.tool.core;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.yoki.tool.core.build.impl.DomainMavenBuilder;
import org.yoki.tool.core.config.DatabaseConfig;
import org.yoki.tool.core.config.BuilderConfig;

import java.net.URL;

/**
 * Created by SunnyWen on 2017/7/24.
 */
@SpringBootApplication
public class MainClass {

    public static void main(String[] args) {
        SpringApplication.run(MainClass.class , args) ;
        BuilderConfig cfg = new BuilderConfig(new DatabaseConfig()) ;
        cfg.setSavePath("C:\\Users\\SKY\\Desktop\\code");
        cfg.setMavenName("yoki-domain") ;
        cfg.setTemplatePath("classpath:tamplates\\domain");
        try {
            CodeBuildFactory codeBuildFactory = new CodeBuildFactory( cfg , new DomainMavenBuilder()) ;
            codeBuildFactory.build();
        } catch (Exception e) {
            e.printStackTrace();
        }
//        URL path = MainClass.class.getProtectionDomain().getCodeSource().getLocation();
//        System.out.println("---------------->>" + path);
        System.exit(0);

    }

}
